Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to inherit services #625

Closed
wants to merge 3 commits into from
Closed

Add ability to inherit services #625

wants to merge 3 commits into from

Conversation

matthuisman
Copy link

#610

Just initial code for discussion.

Currently, attributes 'command' 'ports' and 'name' won't be copied over to child.

example fig.yml to use

serviceA:
  image: ubuntu:14.04
  volumes:
    - /serviceA:/serviceA
  environment:
    PROJECT: services
    SERVICE: serviceA
  command: /bin/sh -c "while true; do echo $PROJECT; echo $SERVICE; echo ServiceA $(date) > /serviceA/date; sleep 1; done"

serviceB:
  inherits: serviceA
  volumes:
    - /serviceB:/serviceB
  environment:
    SERVICE: serviceB
  command: /bin/sh -c "while true; do echo $PROJECT; echo $SERVICE; echo $(cat /serviceA/date); echo ServiceB $(date) > /serviceB/date; sleep 1;  done"

serviceC:
  inherits: serviceB
  command: /bin/sh -c "while true; do echo $PROJECT; echo $SERVICE; echo $(cat /serviceA/date); echo $(cat /serviceB/date); sleep 1;  done"

To Do:
Add tests
Rename: DONT_INHERIT to something nicer
Maybe make the keyword something else: "extends"?
Possibly an option to disable inherit of certain attribute

@matthuisman matthuisman changed the title Add ability to inherit attributes from services Add ability to inherit services Nov 7, 2014
matthuisman added 2 commits November 7, 2014 13:50
@matthuisman matthuisman mentioned this pull request Nov 7, 2014
@dnephin
Copy link

dnephin commented May 31, 2015

This is now supported with extends

@dnephin dnephin closed this May 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants